package com.opensource.component.model.po;

import com.opensource.component.base.AbstractPo;
import com.opensource.component.model.po.UserAmountPo.UserAmountTableShardingStrategy;
import com.opensource.component.query.sharding.TableSharding;
import com.opensource.component.query.sharding.TableShardingStrategy;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

/**
 * -持久化
 *
 * @author ZonLen since on 2021-12-18 22:00:49
 */

@Getter
@Setter
@TableName("user_amount")
@TableSharding(sharding = UserAmountTableShardingStrategy.class)
public class UserAmountPo extends AbstractPo {

  private Long userId;

  private BigDecimal amount;
  /**
   * 删除标识(0:未删除，1:已删除) <dr(java.lang.Long)>
   */
  private Long dr;


  public static class UserAmountTableShardingStrategy implements TableShardingStrategy {

    @Override
    public String shardingTableName(String orgTableName) {
      return orgTableName + 1;
    }
  }
}

